package yunquan.wang.modules.base.service;

import java.util.Collection;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specifications;

import yunquan.wang.modules.base.entity.Messages;

public interface MessageService {
	/**
	 *  Query the message whic was send
	 * @param specefications
	 * @param page
	 * @return
	 */
	public Page<Messages> getSendMessage(Specifications specefications,Pageable page);
	
	/**
	 *  Query the message whic was recevie
	 * @param specefications
	 * @param page
	 * @return
	 */
	public Page<Messages> recevieMessage(Specifications specefications,Pageable page);
	
	/**
	 * send the message
	 * @param endity
	 */
	public void sendMessage(Messages endity);
	
	/**
	 * save the message,not send
	 * @param endity
	 */
	public void saveMessage(Messages endity);
	/**
	 * query unread messages count by userID
	 * @return
	 */
	public Integer queryUnreadMessage();
	/**
	 * get the message.init body and attachment
	 * update the read status
	 * @param id
	 * @return
	 */
	public Messages readMessage(String id);
 
	/**
	 * delete method
	 * @param id
	 */

	public void deleteRecevieMessage(String id);
	
	public void deleteSendMessage(String id);
	/**
	 * delete attachments
	 */
	public void deleteAttachements(Collection ids);
}
